package util;

import java.util.Random;

import logic.Vec2D;

public class Util {
	
	public static final Random rnd = new Random();
	
	public static float lerp(float a, float b, float x)
	{
		return a + (b - a) * x; 
	}
	
	public static float lerpC(float a, float b, float x)
	{
		if(x < 0.0f) x = 0.0f;
		if(x > 1.0f) x = 1.0f;
		return a + (b - a) * x;
	}
	
	public static Vec2D lerp(Vec2D a, Vec2D b, float x)
	{
		return new Vec2D(lerp(a.x(), b.x(), x), lerp(a.y(), b.y(), x));
	}
}
